package com.example.serenity.controller.model;

import lombok.Data;

/**
 * 封装返回数据类
 */
@Data
public class Response<T>{
    private String code;  //返回代码 1：正常  2：出错
    private String message; //返回消息
    private T data;  //数据项
    public Response(String code, String message){
        this.code = code;
        this.message = message;
    }
    public Response(){
        this.code = "0";
        this.message = "系统错误";
    }
    public Response(T data){
        this.code = "1";
        this.data = data;
    }
}
